﻿using System;
using System.Collections;
using System.Linq;
using X.PagedList;

namespace LsTool
{
    public class TableData<T>
    {
        public TableData(IPagedList<T> pl)
        {
            rows = pl.ToList();
            total = pl.TotalItemCount;
        }

        public TableData(IPagedList<T> pl, Func<T, object> select) : this(pl)
        {
            rows = pl.Select(select).ToList();
        }
        /// <summary>
        /// list
        /// </summary>
        public IEnumerable rows { get; set; }
        /// <summary>
        /// 总数
        /// </summary>
        public int total { get; set; }

    }
}